package org.honeyweb.gsoc.pages;



import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.Service;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.corelib.components.Form;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.honeyweb.gsoc.services.UsersManager;


@SuppressWarnings("unused")
public class RegistrationUser {
	
	private final Log logger = LogFactory.getLog(RegistrationUser.class);
	
	@Inject
	@Service("usersManager")
	private UsersManager usersManager;

	
	@Component
	private Form form;
	
	@Property
	private String firstName;
	
	@Property
	private String lastName;
	
	@Property
	private String userName;
	
	@Property
	private String password;
	
	@Property
	private String retypePassword;
	
	@Property
	private String mail;
	
	
	
	String onSuccess(){
		logger.debug("userName is:"+userName+"password is: [PROTECTED]");
		usersManager.addUser(userName,password,retypePassword,firstName,lastName,mail);
		return "connect";
	};

	


	
}
